package com.yic.module.mes.controller.admin.plan.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

import static com.yic.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 生产计划单身同步 Request VO")
@Data
@ToString(callSuper = true)
public class PlanDSyncReqVO {

    @Schema(description = "序号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "序号不能为空")
    private String sequenceNumber;

    @Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "产品ID不能为空")
    private String itemId;

    @Schema(description = "产品代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "产品代码不能为空")
    private String itemCode;

    @Schema(description = "取替代方式", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "取替代方式不能为空")
    private String replaceItem;

    @Schema(description = "上阶主件品号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "上阶主件品号不能为空")
    private String upLevelItemId;

    @Schema(description = "被取代品号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "被取代品号不能为空")
    private String replaceItemId;

    @Schema(description = "需求数量", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "需求数量不能为空")
    private BigDecimal needAmount;

    @Schema(description = "需求数量", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "需求数量不能为空")
    private BigDecimal replaceAmount;

    @Schema(description = "仓库ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "仓库ID不能为空")
    private String warehouseId;

    @Schema(description = "仓库代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "仓库代码不能为空")
    private String warehouseCode;

    @Schema(description = "库位ID", requiredMode = Schema.RequiredMode.REQUIRED)
    private String locationId;

    @Schema(description = "库位代码", requiredMode = Schema.RequiredMode.REQUIRED)
    private String locationCode;

    @Schema(description = "领料类型", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "领料类型不能为空")
    private String type;

    @Schema(description = "预计领料日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "预计领料日期不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private Date planIssueDate;

    @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
    private String remark;

    @Schema(description = "超领率", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "超领率不能为空")
    private BigDecimal issueOverrunRate;

    @Schema(description = "缺领率", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "缺领率不能为空")
    private BigDecimal issueShorttageRate;

    @Schema(description = "投料间距", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "投料间距不能为空")
    private Integer issueMatertalPeriod;

    @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "单位ID不能为空")
    private String unitId;

    @Schema(description = "批号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "批号不能为空")
    private String itemLotId;

    @Schema(description = "最低领用量", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "最低领用量不能为空")
    private BigDecimal lastRequiredQty;

}
